home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / libbonobo-2.0 / bonobo / bonobo-stream-memory.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-01-09  |  2.2 KB  |  69 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
  2. /**
  3.  * bonobo-stream-memory.h: Memory based stream
  4.  *
  5.  * Author:
  6.  *   Miguel de Icaza (miguel@gnu.org)
  7.  *
  8.  * Copyright 1999, 2000 Helix Code, Inc.
  9.  */
  10. #ifndef _BONOBO_STREAM_MEM_H_
  11. #define _BONOBO_STREAM_MEM_H_
  12.  
  13. #include <bonobo/bonobo-storage.h>
  14.  
  15. G_BEGIN_DECLS
  16.  
  17. struct _BonoboStreamMem;
  18. typedef struct _BonoboStreamMem BonoboStreamMem;
  19. typedef struct _BonoboStreamMemPrivate BonoboStreamMemPrivate;
  20.  
  21. #define BONOBO_TYPE_STREAM_MEM        (bonobo_stream_mem_get_type ())
  22. #define BONOBO_STREAM_MEM_TYPE        BONOBO_TYPE_STREAM_MEM /* deprecated, you should use BONOBO_TYPE_STREAM_MEM */
  23. #define BONOBO_STREAM_MEM(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), BONOBO_TYPE_STREAM_MEM, BonoboStreamMem))
  24. #define BONOBO_STREAM_MEM_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), BONOBO_TYPE_STREAM_MEM, BonoboStreamMemClass))
  25. #define BONOBO_IS_STREAM_MEM(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), BONOBO_TYPE_STREAM_MEM))
  26. #define BONOBO_IS_STREAM_MEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BONOBO_TYPE_STREAM_MEM))
  27.  
  28. struct _BonoboStreamMem {
  29.     BonoboObject parent;
  30.  
  31.     char         *buffer;
  32.     size_t        size;
  33.     long          pos;
  34.     gboolean      read_only;
  35.     gboolean      resizable;
  36.     char         *content_type;
  37.     char         *name;
  38.  
  39.     BonoboStreamMemPrivate *priv;
  40. };
  41.  
  42. typedef struct {
  43.     BonoboObjectClass parent_class;
  44.  
  45.     POA_Bonobo_Stream__epv epv;
  46.  
  47.     char           *(*get_buffer) (BonoboStreamMem *stream_mem);
  48.     size_t          (*get_size)   (BonoboStreamMem *stream_mem);
  49. } BonoboStreamMemClass;
  50.  
  51. GType            bonobo_stream_mem_get_type   (void) G_GNUC_CONST;
  52. BonoboStreamMem *bonobo_stream_mem_construct  (BonoboStreamMem  *stream_mem,
  53.                            const char       *buffer,
  54.                            size_t            size,
  55.                            gboolean          read_only,
  56.                            gboolean          resizable);
  57.  
  58. BonoboObject    *bonobo_stream_mem_create     (const char       *buffer,
  59.                            size_t            size,
  60.                            gboolean          read_only,
  61.                            gboolean          resizable);
  62.  
  63. const char      *bonobo_stream_mem_get_buffer (BonoboStreamMem  *stream_mem);
  64. size_t           bonobo_stream_mem_get_size   (BonoboStreamMem  *stream_mem);
  65.  
  66. G_END_DECLS
  67.  
  68. #endif /* _BONOBO_STREAM_MEM_H_ */
  69.